package com.hctg.forced2sleep.dialog;

import android.content.Context;
import android.os.Bundle;
import android.text.Html;

import com.actor.myandroidframework.dialog.ViewBindingDialog;
import com.blankj.utilcode.util.SizeUtils;
import com.hctg.forced2sleep.activity.VipBuyActivity;
import com.hctg.forced2sleep.databinding.DialogVipBuyBinding;

/**
 * description: 会员购买Dialog
 * company    :
 *
 * @author : ldf
 * date       : 2024/12/1 on 15
 * @version 1.0
 */
public class VipBuyDialog extends ViewBindingDialog<DialogVipBuyBinding> {

    public VipBuyDialog(Context context) {
        super(context);
        setWidthPercent(0.888888f, SizeUtils.dp2px(308f));
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String content = "该功能为<big><strong><font color='#F45075'>VIP特权</font></strong></big>功能，专注研发不易，我们会持续更新，提供更优质服务~相信您也能一起加油~";;
        viewBinding.ivClose.setOnClickListener(v -> dismiss());
        viewBinding.tvContent.setText(Html.fromHtml(content));
        viewBinding.tvCancel.setOnClickListener(v -> dismiss());
        viewBinding.tvYes.setOnClickListener(v -> {
            dismiss();
            VipBuyActivity.start(getContext());
        });
    }
}
